/***********************************************************************
 * Module:  Npc.java
 * Author:  luohaoyang
 * Purpose: Defines the Class NPC
 ***********************************************************************/

package com.afteryuan.engine.model;
                
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

import com.afteryuan.dao.BaseObject;

@Entity
@Table(name = "T_USERCARTOON")
public class UserCartoon extends BaseObject {

	private String id;
    /**
     * 默认情况下,cartoonId
     */
    private String cartoonId;
    /**
     * 用户ID
     */
    private String userId;

    private String description;
    private Long createTime;

    public UserCartoon() {
        setCreateTime(new Date().getTime());
    }

    public UserCartoon(String id) {
        this();
        this.id = id;
    }

    public UserCartoon(String userId, String cartoonId) {
        this();
        this.userId = userId;
        this.cartoonId = cartoonId;
    }

    @Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCartoonId() {
        return cartoonId;
    }

    public void setCartoonId(String cartoonId) {
        this.cartoonId = cartoonId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }


    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    @Column(updatable = false)
    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserCartoon that = (UserCartoon) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "UserCartoon{" +
                "id='" + id + '\'' +
                ", cartoonId='" + cartoonId + '\'' +
                ", userId='" + userId + '\'' +
                ", description='" + description + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}